package com.liujit.upms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liujit.upms.domain.model.SysOrg;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Description 系统机构Mapper
 * @Author liujun
 * @Date 2021-07-02 15:00:39
 */
@Mapper
public interface SysOrgMapper extends BaseMapper<SysOrg> {

    /**
     * 查询父id最大code
     *
     * @param pid
     * @return
     * @author: liujun
     * @date: 2021/7/5 7:40 下午
     */
    @Select("select max(code) maxCode from sys_org where pid = #{pid}")
    String selMaxCodeByPid(Long pid);
}